\(\int \frac {\arctan (x) \log (1+x^2)}{x^2} \, dx\) [1281]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [F]
   Sympy [C] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 41 \[ \int \frac {\arctan (x) \log \left (1+x^2\right )}{x^2} \, dx=\arctan (x)^2-\frac {\arctan (x) \log \left (1+x^2\right )}{x}-\frac {1}{4} \log ^2\left (1+x^2\right )-\frac {\operatorname {PolyLog}\left (2,-x^2\right )}{2} \]

[Out]

arctan(x)^2-arctan(x)*ln(x^2+1)/x-1/4*ln(x^2+1)^2-1/2*polylog(2,-x^2)

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.000, Rules used = {4946, 272, 36, 29, 31, 5137, 2525, 2457, 2437, 2338, 2438, 5004} \[ \int \frac {\arctan (x) \log \left (1+x^2\right )}{x^2} \, dx=-\frac {\arctan (x) \log \left (x^2+1\right )}{x}+\arctan (x)^2-\frac {\operatorname {PolyLog}\left (2,-x^2\right )}{2}-\frac {1}{4} \log ^2\left (x^2+1\right ) \]

[In]

Int[(ArcTan[x]*Log[1 + x^2])/x^2,x]

[Out]

ArcTan[x]^2 - (ArcTan[x]*Log[1 + x^2])/x - Log[1 + x^2]^2/4 - PolyLog[2, -x^2]/2

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 272

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2437

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)*(x_))^(q_.), x_Symbol] :> Dist[1/
e, Subst[Int[(f*(x/d))^q*(a + b*Log[c*x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p, q}, x]
 && EqQ[e*f - d*g, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 2457

Int[(Log[(c_.)*((d_) + (e_.)*(x_))]*(x_)^(m_.))/((f_) + (g_.)*(x_)), x_Symbol] :> Int[ExpandIntegrand[Log[c*(d
 + e*x)], x^m/(f + g*x), x], x] /; FreeQ[{c, d, e, f, g}, x] && EqQ[e*f - d*g, 0] && EqQ[c*d, 1] && IntegerQ[m
]

Rule 2525

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.)*((f_) + (g_.)*(x_)^(s_))^(r_.),
 x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(f + g*x^(s/n))^r*(a + b*Log[c*(d + e*x)^p])^q,
x], x, x^n], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q, r, s}, x] && IntegerQ[r] && IntegerQ[s/n] && Intege
rQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0])

Rule 4946

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*((a + b*ArcTan[c*x^
n])^p/(m + 1)), x] - Dist[b*c*n*(p/(m + 1)), Int[x^(m + n)*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))),
x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1] && IntegerQ[m])) && NeQ[m, -1]

Rule 5004

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rule 5137

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*(e_.))*(x_)^(m_.), x_Symbol] :> Simp
[x^(m + 1)*(d + e*Log[f + g*x^2])*((a + b*ArcTan[c*x])/(m + 1)), x] + (-Dist[b*(c/(m + 1)), Int[x^(m + 1)*((d
+ e*Log[f + g*x^2])/(1 + c^2*x^2)), x], x] - Dist[2*e*(g/(m + 1)), Int[x^(m + 2)*((a + b*ArcTan[c*x])/(f + g*x
^2)), x], x]) /; FreeQ[{a, b, c, d, e, f, g}, x] && ILtQ[m/2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {\arctan (x) \log \left (1+x^2\right )}{x}+2 \int \frac {\arctan (x)}{1+x^2} \, dx+\int \frac {\log \left (1+x^2\right )}{x \left (1+x^2\right )} \, dx \\ & = \arctan (x)^2-\frac {\arctan (x) \log \left (1+x^2\right )}{x}+\frac {1}{2} \text {Subst}\left (\int \frac {\log (1+x)}{x (1+x)} \, dx,x,x^2\right ) \\ & = \arctan (x)^2-\frac {\arctan (x) \log \left (1+x^2\right )}{x}+\frac {1}{2} \text {Subst}\left (\int \left (\frac {\log (1+x)}{-1-x}+\frac {\log (1+x)}{x}\right ) \, dx,x,x^2\right ) \\ & = \arctan (x)^2-\frac {\arctan (x) \log \left (1+x^2\right )}{x}+\frac {1}{2} \text {Subst}\left (\int \frac {\log (1+x)}{-1-x} \, dx,x,x^2\right )+\frac {1}{2} \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,x^2\right ) \\ & = \arctan (x)^2-\frac {\arctan (x) \log \left (1+x^2\right )}{x}-\frac {\operatorname {PolyLog}\left (2,-x^2\right )}{2}-\frac {1}{2} \text {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,1+x^2\right ) \\ & = \arctan (x)^2-\frac {\arctan (x) \log \left (1+x^2\right )}{x}-\frac {1}{4} \log ^2\left (1+x^2\right )-\frac {\operatorname {PolyLog}\left (2,-x^2\right )}{2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.00 \[ \int \frac {\arctan (x) \log \left (1+x^2\right )}{x^2} \, dx=\arctan (x)^2-\frac {\arctan (x) \log \left (1+x^2\right )}{x}-\frac {1}{4} \log ^2\left (1+x^2\right )-\frac {\operatorname {PolyLog}\left (2,-x^2\right )}{2} \]

[In]

Integrate[(ArcTan[x]*Log[1 + x^2])/x^2,x]

[Out]

ArcTan[x]^2 - (ArcTan[x]*Log[1 + x^2])/x - Log[1 + x^2]^2/4 - PolyLog[2, -x^2]/2

Maple [F]

\[\int \frac {\arctan \left (x \right ) \ln \left (x^{2}+1\right )}{x^{2}}d x\]

[In]

int(arctan(x)*ln(x^2+1)/x^2,x)

[Out]

int(arctan(x)*ln(x^2+1)/x^2,x)

Fricas [F]

\[ \int \frac {\arctan (x) \log \left (1+x^2\right )}{x^2} \, dx=\int { \frac {\arctan \left (x\right ) \log \left (x^{2} + 1\right )}{x^{2}} \,d x } \]

[In]

integrate(arctan(x)*log(x^2+1)/x^2,x, algorithm="fricas")

[Out]

integral(arctan(x)*log(x^2 + 1)/x^2, x)

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 37.83 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.90 \[ \int \frac {\arctan (x) \log \left (1+x^2\right )}{x^2} \, dx=- \frac {\log {\left (x^{2} + 1 \right )}^{2}}{4} + \operatorname {atan}^{2}{\left (x \right )} - \frac {\operatorname {Li}_{2}\left (x^{2} e^{i \pi }\right )}{2} - \frac {\log {\left (x^{2} + 1 \right )} \operatorname {atan}{\left (x \right )}}{x} \]

[In]

integrate(atan(x)*ln(x**2+1)/x**2,x)

[Out]

-log(x**2 + 1)**2/4 + atan(x)**2 - polylog(2, x**2*exp_polar(I*pi))/2 - log(x**2 + 1)*atan(x)/x

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.41 \[ \int \frac {\arctan (x) \log \left (1+x^2\right )}{x^2} \, dx=-{\left (\frac {\log \left (x^{2} + 1\right )}{x} - 2 \, \arctan \left (x\right )\right )} \arctan \left (x\right ) - \arctan \left (x\right )^{2} + \frac {1}{2} \, \log \left (-x^{2}\right ) \log \left (x^{2} + 1\right ) - \frac {1}{4} \, \log \left (x^{2} + 1\right )^{2} + \frac {1}{2} \, {\rm Li}_2\left (x^{2} + 1\right ) \]

[In]

integrate(arctan(x)*log(x^2+1)/x^2,x, algorithm="maxima")

[Out]

-(log(x^2 + 1)/x - 2*arctan(x))*arctan(x) - arctan(x)^2 + 1/2*log(-x^2)*log(x^2 + 1) - 1/4*log(x^2 + 1)^2 + 1/
2*dilog(x^2 + 1)

Giac [F]

\[ \int \frac {\arctan (x) \log \left (1+x^2\right )}{x^2} \, dx=\int { \frac {\arctan \left (x\right ) \log \left (x^{2} + 1\right )}{x^{2}} \,d x } \]

[In]

integrate(arctan(x)*log(x^2+1)/x^2,x, algorithm="giac")

[Out]

integrate(arctan(x)*log(x^2 + 1)/x^2, x)

Mupad [B] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.88 \[ \int \frac {\arctan (x) \log \left (1+x^2\right )}{x^2} \, dx={\mathrm {atan}\left (x\right )}^2-\frac {{\ln \left (x^2+1\right )}^2}{4}-\frac {{\mathrm {Li}}_{\mathrm {2}}\left (x^2+1\right )}{2}-\frac {\ln \left (x^2+1\right )\,\mathrm {atan}\left (x\right )}{x} \]

[In]

int((log(x^2 + 1)*atan(x))/x^2,x)

[Out]

atan(x)^2 - log(x^2 + 1)^2/4 - dilog(x^2 + 1)/2 - (log(x^2 + 1)*atan(x))/x